#ifndef QBaiduAIIO_H
#define QBaiduAIIO_H
#include <QObject>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QSslConfiguration>
#include <QtNetwork/QNetworkReply>
#include <QUrl>
#include <QTimer>
#include <QEventLoop>
#include "qjsonconfig.h"
#include "qmessageopt.h"

class QBaiduAIIO : public QObject
{
    Q_OBJECT
public:
    explicit QBaiduAIIO(QObject *parent = nullptr);

    int Ask(const QString& sAsk,QString& sResponse);
protected:
    QString GetAccessToken();
    QString GetResponse(const QByteArray& json);
protected:
    QString m_sClientId;
    QString m_sClientSecret;
    QString m_sAccessToken;
    QMessageOpt m_cMessage;
signals:
    void sigShowRespon(QString sRespon);
};

#endif // QBaiduAIIO_H
